#pragma once
#include "frame.h"
#include <QVector>

class FrameDrive : public Frame
{
  public:
    enum class GearSelection
    {
        gear_N = 0b000,
        gear_centeer_veer = 0b001,
        gear_D = 0b010,
        gear_R = 0b011,
        gear_P = 0b100
    };
    enum class SteeringMode
    {
        front_axle_steering = 0b00,
        diagonal_steering = 0b01,
        small_radius_steering = 0b10,
        center_steering = 0b11
    };
    enum class PowerOff
    {
        close = 0,
        open = 1
    };
    enum class EmergencyStop
    {
        close = 0,
        open = 1
    };
    enum class Parking
    {
        close = 0,
        open = 1
    };
    enum class ControlMode
    {
        remote_control_mode = 0b01,
        autonomous_mode = 0b10
    };
    enum class HardcoreMode
    {
        close = 0b00,
        gear_1 = 0b01,
        gear_2 = 0b10,
        gear_3 = 0b11
    };
    enum class D1TemporarySwitch
    {
        close = 0,
        D1 = 1
    };
    enum class DodgeMode
    {
        close = 0,
        open = 1
    };
    enum class Low_pressurePumpControl
    {
        close = 0x00,
        open = 0x01
    };
    enum class CenterSteeringReset
    {
        none = 0x00,
        reset = 0x01
    };
    enum class High_voltageSwitch
    {
        close = 0,
        open = 1
    };
    enum class DriveMotorController
    {
        close = 0,
        open = 1
    };
    enum class HighBeam
    {
        close = 0,
        open = 1
    };
    enum class LowBeam
    {
        close = 0,
        open = 1
    };
    enum class FogLights
    {
        close = 0,
        open = 1
    };
    enum class Horn
    {
        close = 0,
        open = 1
    };
    enum class DefensePowerOn
    {
        close = 0,
        open = 1
    };
    enum class Fan
    {
        close = 0,
        open = 1
    };
    enum class RefrigerationUnit
    {
        close = 0,
        open = 1
    };

  public:
    float gas_pedal_depth;
    float steering_wheel_corners;
    float brake_pedal_depth;
    GearSelection gear_selection;
    SteeringMode steering_mode;
    PowerOff power_off;
    EmergencyStop emergency_stop;
    Parking parking;
    float speed_limit;
    ControlMode control_mode;
    HardcoreMode hardcore_mode;
    D1TemporarySwitch D1_temporary_switch;
    DodgeMode dodge_mode;
    Low_pressurePumpControl low_pressure_pump_control;
    CenterSteeringReset center_steering_reset;
    High_voltageSwitch high_voltage_switch;
    DriveMotorController drive_motor_controller;
    HighBeam highBeam;
    LowBeam low_beam;
    FogLights fog_lights;
    Horn horn;
    DefensePowerOn defense_power_on;
    Fan fan;
    RefrigerationUnit refrigeration_unit;
    float heartbeat;

  public:
    explicit FrameDrive(QObject *parent = nullptr);
    ~FrameDrive() = default;
    QByteArray EncodeToBytes() const;
    void DecodeFromBytes(const QByteArray &data);
    QString GetFrameName() const;
};